<?php 
include("config.class.php");
$ip = sprintf("%u", ip2long(trim($_GET['ip'])));
$sql1 = "SELECT `locId` FROM `blocks` WHERE ( ".$ip." BETWEEN `startIpNum` AND `endIpNum` ) ;";
mysql_connect($host,$user,$pass);
mysql_select_db($db);
#die($sql1);
$res = mysql_query($sql1) or die(mysql_error());
$arr = mysql_fetch_array($res);
$locid = $arr[0];
$sql2 = "SELECT `latitude` , `longitude` FROM `location` WHERE `locId` =".$locid.";";
$res = mysql_query($sql2) or die(mysql_error());
$arr = mysql_fetch_array($res);
print $arr[0];
print ":";
print $arr[1];
?>
